import request from '@/utils/request'


// 舆情数量按省分组
export function getPublicOpinionCountGroupByProvinceOfTopicId(query) {
  return request({
    url: '/system/topic/getPublicOpinionCountGroupByProvinceOfTopicId',
    method: 'get',
    params: query
  })
}


// 信息总览
export function getAllInformation(query) {
  return request({
    url: '/system/topic/getAllInformation',
    method: 'get',
    params: query
  })
}

//互动声量
export function getInteractiveInformation(query) {
  return request({
    url: '/system/topic/getInteractiveInformation',
    method: 'get',
    params: query
  })
}

//影响力
export function getInfluenceValue(query) {
  return request({
    url: '/system/topic/getInfluenceValue',
    method: 'get',
    params: query
  })
}




// 媒体活跃排行榜（情感）
export function countSensitiveOpinionByMediaName(query) {
  return request({
    url: '/system/topic/countSensitiveOpinionByMediaName',
    method: 'get',
    params: query
  })
}
// 意见领袖排行（情感）
export function countSensitiveAuthorOpinion(query) {
  return request({
    url: '/system/topic/countSensitiveAuthorOpinion',
    method: 'get',
    params: query
  })
}

// 信息载体趋势图
export function getMediaTypeByPublishTimeByTopicId(query) {
  return request({
    url: '/system/topic/getMediaTypeByPublishTimeByTopicId',
    method: 'get',
    params: query
  })
}


// 查询舆情主题列表
export function listTopic(query) {
  return request({
    url: '/system/topic/list',
    method: 'get',
    params: query
  })
}

// 查询舆情主题详细
export function getTopic(id) {
  return request({
    url: '/system/topic/' + id,
    method: 'get'
  })
}

// 新增舆情主题
export function addTopic(data) {
  return request({
    url: '/system/topic',
    method: 'post',
    data: data
  })
}

// 修改舆情主题
export function updateTopic(data) {
  return request({
    url: '/system/topic',
    method: 'put',
    data: data
  })
}

// 删除舆情主题
export function delTopic(id) {
  return request({
    url: '/system/topic/' + id,
    method: 'delete'
  })
}

// 导出舆情主题
export function exportTopic(query) {
  return request({
    url: '/system/topic/export',
    method: 'get',
    params: query
  })
}




//根据主题id获取舆情列表（从军犬读取）
export function queryByTopicId(data,pageParams) {
  return request({
    url: `/system/opinion/queryByTopicId/${ data.topicId }`,
    method: 'post',
    data: data,
    params: pageParams
  })
}


// 获取正负面信息趋势图
export function getSentimentByPublishTimeByTopicId(query) {
  return request({
    url: '/system/topic/getSentimentByPublishTimeByTopicId',
    method: 'get',
    params: query
  })
}


// 获取主题热词
export function getKeywordsByTopicId(query) {
  return request({
    url: '/system/topic/getKeywordsByTopicId',
    method: 'get',
    params: query
  })
}





